﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _09_CountingDuplicates
{
    public class Kata
    {
        public static int DuplicateCount(string str)
        {
            var temp = str.ToUpper().Distinct().ToArray();
            int maxCount = 0;
            foreach (var item in temp)
            {
                if (str.ToUpper().Count(i => item.ToString().Contains(i)) != 1)
                    maxCount++;
            }
            return maxCount;
        }
    }
}
